/**
 * 
 */
package com.sx.cms.biz.impl;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.sx.cms.biz.ICityInfoBiz;
import com.sx.cms.dao.ICityInfoDao;
import com.sx.cms.entity.CityInfoEntity;
import com.sx.feesunit.exception.SXException;
import com.sx.rbac.entity.SysUserEntity;

/**
 * @author Administrator
 *
 */
public class CityInfoBiz implements ICityInfoBiz {
	private Log log = LogFactory.getLog(this.getClass());
	private ICityInfoDao cityinfodao;
	
	/* (non-Javadoc)
	 * @see com.sx.cms.biz.ICityInfoBiz#queryAgenterUserCount(com.sx.cms.entity.CityInfoEntity)
	 */
	public Integer queryAgenterUserCount(CityInfoEntity cityinfo)
			throws SXException {
		Integer count = new Integer(0);
		try {
			count = cityinfodao.queryAgenterUserCount(cityinfo);
		} catch (Exception e) {
			log.error("获取城市代理商数量信息",e);
			throw new SXException();
			// TODO: handle exception
		}
		return count;
	}

	/* (non-Javadoc)
	 * @see com.sx.cms.biz.ICityInfoBiz#queryAgenterUserInfo(com.sx.cms.entity.CityInfoEntity)
	 */
	public List<SysUserEntity> queryAgenterUserInfo(CityInfoEntity cityinfo)
			throws SXException {
		List<SysUserEntity> list = new ArrayList<SysUserEntity>();
		try {
			list = cityinfodao.queryAgenterUserInfo(cityinfo);
		} catch (Exception e) {
			log.error("获取城市代理商信息出错",e);
			throw new SXException();
			// TODO: handle exception
		}
		return list;
	}

	/* (non-Javadoc)
	 * @see com.sx.cms.biz.ICityInfoBiz#findCityInfosTotal(com.sx.cms.entity.CityInfoEntity)
	 */
	public Integer findCityInfosTotal(CityInfoEntity cityinfo)
			throws SXException {
		Integer count = new Integer(0);
		try {
			count = cityinfodao.findCityInfosTotal(cityinfo);
		} catch (Exception e) {
			log.error("获取城市代理商数量信息",e);
			throw new SXException();
			// TODO: handle exception
		}
		return count;
	}

	/**
	 * 
	 */
	public CityInfoBiz() {
		// TODO Auto-generated constructor stub
	}

	/* (non-Javadoc)
	 * @see com.sx.cms.biz.ICityInfoBiz#findCityInfosByPaging(com.sx.cms.entity.CityInfoEntity)
	 */
	public List<CityInfoEntity> findCityInfosByPaging(CityInfoEntity cityinfo)
			throws SXException {
		List<CityInfoEntity> list = new ArrayList<CityInfoEntity>();
		try {
			list = cityinfodao.findCityInfosByPaging(cityinfo);
		} catch (Exception e) {
			log.error("获取城市代理商信息",e);
			throw new SXException();
			// TODO: handle exception
		}
		return list;
	}

	/* (non-Javadoc)
	 * @see com.sx.cms.biz.ICityInfoBiz#findCityInfos(com.sx.cms.entity.CityInfoEntity)
	 */
	public List<CityInfoEntity> findCityInfos(CityInfoEntity cityinfo)
			throws SXException {
		List<CityInfoEntity> list = new ArrayList<CityInfoEntity>();
		try {
			list = cityinfodao.findCityInfos(cityinfo);
		} catch (Exception e) {
			log.error("获取城市信息",e);
			throw new SXException();
			// TODO: handle exception
		}
		return list;
	}
	
	/**
	 * @return the cityinfodao
	 */
	public ICityInfoDao getCityinfodao() {
		return cityinfodao;
	}

	/**
	 * @param cityinfodao the cityinfodao to set
	 */
	public void setCityinfodao(ICityInfoDao cityinfodao) {
		this.cityinfodao = cityinfodao;
	}

}
